Namespace some auxiliary files
authorMatthias Clasen <mclasen@redhat.com>
Mon, 1 Apr 2019 12:30:39 +0000 (08:30 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 1 Apr 2019 12:30:39 +0000 (08:30 -0400)
We install a few helper files for the ui file
format. Namespace these, to avoid conflict with
the same files in GTK3.

gtk/tools/gtk4builder.its [new file with mode: 0644]
gtk/tools/gtk4builder.loc [new file with mode: 0644]
gtk/tools/gtk4builder.rng [new file with mode: 0644]
gtk/tools/gtkbuilder.its [deleted file]
gtk/tools/gtkbuilder.loc [deleted file]
gtk/tools/gtkbuilder.rng [deleted file]

diff --git a/gtk/tools/gtk4builder.its b/gtk/tools/gtk4builder.its
new file mode 100644 (file)
index 0000000..689ef0d
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<its:rules xmlns:its="http://www.w3.org/2005/11/its"
+           xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0"
+           version="2.0">
+  <its:translateRule selector="/interface" translate="no"/>
+  <its:translateRule selector="/interface//*[@translatable = 'yes']"
+                     translate="yes"/>
+
+  <!-- The 'comment' attribute should be extracted as a translator comment.  -->
+  <its:locNoteRule selector="/interface//*[@comments]"
+                   locNotePointer="@comments"
+                   locNoteType="alert"/>
+  <gt:escapeRule selector="/interface//@comments" escape="no"/>
+
+  <!-- The 'context' attribute should be extracted as msgctxt.  -->
+  <gt:contextRule selector="/interface//*[@context]" contextPointer="@context"/>
+
+  <its:preserveSpaceRule selector="/interface" space="preserve"/>
+
+  <!-- Extracted strings are consumed by the library and are never
+       merged back; we don't want to escape special characters.  -->
+  <gt:escapeRule selector="/interface" escape="no"/>
+</its:rules>
diff --git a/gtk/tools/gtk4builder.loc b/gtk/tools/gtk4builder.loc
new file mode 100644 (file)
index 0000000..5d77e48
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<locatingRules>
+  <locatingRule name="GtkBuilder" pattern="*.ui">
+    <documentRule localName="interface" target="gtkbuilder.its"/>
+  </locatingRule>
+</locatingRules>
diff --git a/gtk/tools/gtk4builder.rng b/gtk/tools/gtk4builder.rng
new file mode 100644 (file)
index 0000000..032d84d
--- /dev/null
@@ -0,0 +1,341 @@
+<?xml version="1.0"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="">
+  <start>
+    <element name="interface">
+      <optional>
+        <attribute name="domain">
+          <text/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="requires"/>
+          <ref name="object"/>
+          <ref name="template"/>
+          <ref name="menu"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </start>
+  <define name="requires">
+    <element name="requires">
+      <attribute name="lib">
+        <text/>
+      </attribute>
+      <attribute name="version">
+        <text/>
+      </attribute>
+    </element>
+  </define>
+  <define name="object">
+    <element name="object">
+      <optional>
+        <attribute name="id">
+          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+        </attribute>
+      </optional>
+      <attribute name="class">
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="type-func">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="constructor">
+          <text/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="property"/>
+          <ref name="signal"/>
+          <ref name="child"/>
+          <ref name="ANY"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="template">
+    <element name="template">
+      <attribute name="class">
+        <text/>
+      </attribute>
+      <attribute name="parent">
+        <text/>
+      </attribute>
+      <zeroOrMore>
+        <choice>
+          <ref name="property"/>
+          <ref name="signal"/>
+          <ref name="child"/>
+          <ref name="ANY"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="property">
+    <element name="property">
+      <attribute name="name">
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="translatable">
+          <choice>
+            <value>yes</value>
+            <value>no</value>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="comments">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="context">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <group>
+          <attribute name="bind-source">
+            <text/>
+          </attribute>
+          <attribute name="bind-property">
+            <text/>
+          </attribute>
+          <optional>
+            <attribute name="bind-flags">
+              <text/>
+            </attribute>
+          </optional>
+        </group>
+      </optional>
+      <optional>
+        <text/>
+      </optional>
+    </element>
+  </define>
+  <define name="signal">
+    <element name="signal">
+      <attribute name="name">
+        <text/>
+      </attribute>
+      <attribute name="handler">
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="after">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="swapped">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="object">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="last_modification_time">
+          <text/>
+        </attribute>
+      </optional>
+      <empty/>
+    </element>
+  </define>
+  <define name="child">
+    <element name="child">
+      <optional>
+        <attribute name="type">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="internal-child">
+          <text/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="object"/>
+          <ref name="ANY"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="menu">
+    <element name="menu">
+      <attribute name="id">
+        <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+      </attribute>
+      <optional>
+        <attribute name="domain">
+          <text/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="item"/>
+          <ref name="submenu"/>
+          <ref name="section"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="item">
+    <element name="item">
+      <optional>
+        <attribute name="id">
+          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="attribute_"/>
+          <ref name="link"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="attribute_">
+    <element name="attribute">
+      <attribute name="name">
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="type">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="translatable">
+          <choice>
+            <value>yes</value>
+            <value>no</value>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="context">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="comments">
+          <text/>
+        </attribute>
+      </optional>
+      <optional>
+        <text/>
+      </optional>
+    </element>
+  </define>
+  <define name="link">
+    <element name="link">
+      <optional>
+        <attribute name="id">
+          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+        </attribute>
+      </optional>
+      <attribute name="name">
+        <text/>
+      </attribute>
+      <zeroOrMore>
+        <ref name="item"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="submenu">
+    <element name="submenu">
+      <optional>
+        <attribute name="id">
+          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="attribute_"/>
+          <ref name="item"/>
+          <ref name="submenu"/>
+          <ref name="section"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="section">
+    <element name="section">
+      <optional>
+        <attribute name="id">
+          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <choice>
+          <ref name="attribute_"/>
+          <ref name="item"/>
+          <ref name="submenu"/>
+          <ref name="section"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="ANY">
+    <element>
+      <anyName>
+        <except>
+          <name>interface</name>
+          <name>requires</name>
+          <name>object</name>
+          <name>property</name>
+          <name>signal</name>
+          <name>child</name>
+          <name>menu</name>
+          <name>item</name>
+          <name>attribute</name>
+          <name>link</name>
+          <name>submenu</name>
+          <name>section</name>
+        </except>
+      </anyName>
+      <zeroOrMore>
+        <attribute>
+          <anyName/>
+          <text/>
+        </attribute>
+      </zeroOrMore>
+      <interleave>
+        <zeroOrMore>
+          <ref name="ALL"/>
+        </zeroOrMore>
+        <optional>
+          <text/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+  <define name="ALL">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+        <attribute>
+          <anyName/>
+          <text/>
+        </attribute>
+      </zeroOrMore>
+      <interleave>
+        <zeroOrMore>
+          <ref name="ALL"/>
+        </zeroOrMore>
+        <optional>
+          <text/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+</grammar>
diff --git a/gtk/tools/gtkbuilder.its b/gtk/tools/gtkbuilder.its
deleted file mode 100644 (file)
index 689ef0d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<its:rules xmlns:its="http://www.w3.org/2005/11/its"
-           xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0"
-           version="2.0">
-  <its:translateRule selector="/interface" translate="no"/>
-  <its:translateRule selector="/interface//*[@translatable = 'yes']"
-                     translate="yes"/>
-
-  <!-- The 'comment' attribute should be extracted as a translator comment.  -->
-  <its:locNoteRule selector="/interface//*[@comments]"
-                   locNotePointer="@comments"
-                   locNoteType="alert"/>
-  <gt:escapeRule selector="/interface//@comments" escape="no"/>
-
-  <!-- The 'context' attribute should be extracted as msgctxt.  -->
-  <gt:contextRule selector="/interface//*[@context]" contextPointer="@context"/>
-
-  <its:preserveSpaceRule selector="/interface" space="preserve"/>
-
-  <!-- Extracted strings are consumed by the library and are never
-       merged back; we don't want to escape special characters.  -->
-  <gt:escapeRule selector="/interface" escape="no"/>
-</its:rules>
diff --git a/gtk/tools/gtkbuilder.loc b/gtk/tools/gtkbuilder.loc
deleted file mode 100644 (file)
index 5d77e48..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules>
-  <locatingRule name="GtkBuilder" pattern="*.ui">
-    <documentRule localName="interface" target="gtkbuilder.its"/>
-  </locatingRule>
-</locatingRules>
diff --git a/gtk/tools/gtkbuilder.rng b/gtk/tools/gtkbuilder.rng
deleted file mode 100644 (file)
index 032d84d..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-<?xml version="1.0"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="">
-  <start>
-    <element name="interface">
-      <optional>
-        <attribute name="domain">
-          <text/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="requires"/>
-          <ref name="object"/>
-          <ref name="template"/>
-          <ref name="menu"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </start>
-  <define name="requires">
-    <element name="requires">
-      <attribute name="lib">
-        <text/>
-      </attribute>
-      <attribute name="version">
-        <text/>
-      </attribute>
-    </element>
-  </define>
-  <define name="object">
-    <element name="object">
-      <optional>
-        <attribute name="id">
-          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-        </attribute>
-      </optional>
-      <attribute name="class">
-        <text/>
-      </attribute>
-      <optional>
-        <attribute name="type-func">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="constructor">
-          <text/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="property"/>
-          <ref name="signal"/>
-          <ref name="child"/>
-          <ref name="ANY"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="template">
-    <element name="template">
-      <attribute name="class">
-        <text/>
-      </attribute>
-      <attribute name="parent">
-        <text/>
-      </attribute>
-      <zeroOrMore>
-        <choice>
-          <ref name="property"/>
-          <ref name="signal"/>
-          <ref name="child"/>
-          <ref name="ANY"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="property">
-    <element name="property">
-      <attribute name="name">
-        <text/>
-      </attribute>
-      <optional>
-        <attribute name="translatable">
-          <choice>
-            <value>yes</value>
-            <value>no</value>
-          </choice>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="comments">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="context">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <group>
-          <attribute name="bind-source">
-            <text/>
-          </attribute>
-          <attribute name="bind-property">
-            <text/>
-          </attribute>
-          <optional>
-            <attribute name="bind-flags">
-              <text/>
-            </attribute>
-          </optional>
-        </group>
-      </optional>
-      <optional>
-        <text/>
-      </optional>
-    </element>
-  </define>
-  <define name="signal">
-    <element name="signal">
-      <attribute name="name">
-        <text/>
-      </attribute>
-      <attribute name="handler">
-        <text/>
-      </attribute>
-      <optional>
-        <attribute name="after">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="swapped">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="object">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="last_modification_time">
-          <text/>
-        </attribute>
-      </optional>
-      <empty/>
-    </element>
-  </define>
-  <define name="child">
-    <element name="child">
-      <optional>
-        <attribute name="type">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="internal-child">
-          <text/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="object"/>
-          <ref name="ANY"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="menu">
-    <element name="menu">
-      <attribute name="id">
-        <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-      </attribute>
-      <optional>
-        <attribute name="domain">
-          <text/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="item"/>
-          <ref name="submenu"/>
-          <ref name="section"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="item">
-    <element name="item">
-      <optional>
-        <attribute name="id">
-          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="attribute_"/>
-          <ref name="link"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="attribute_">
-    <element name="attribute">
-      <attribute name="name">
-        <text/>
-      </attribute>
-      <optional>
-        <attribute name="type">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="translatable">
-          <choice>
-            <value>yes</value>
-            <value>no</value>
-          </choice>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="context">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="comments">
-          <text/>
-        </attribute>
-      </optional>
-      <optional>
-        <text/>
-      </optional>
-    </element>
-  </define>
-  <define name="link">
-    <element name="link">
-      <optional>
-        <attribute name="id">
-          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-        </attribute>
-      </optional>
-      <attribute name="name">
-        <text/>
-      </attribute>
-      <zeroOrMore>
-        <ref name="item"/>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="submenu">
-    <element name="submenu">
-      <optional>
-        <attribute name="id">
-          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="attribute_"/>
-          <ref name="item"/>
-          <ref name="submenu"/>
-          <ref name="section"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="section">
-    <element name="section">
-      <optional>
-        <attribute name="id">
-          <data type="ID" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
-        </attribute>
-      </optional>
-      <zeroOrMore>
-        <choice>
-          <ref name="attribute_"/>
-          <ref name="item"/>
-          <ref name="submenu"/>
-          <ref name="section"/>
-        </choice>
-      </zeroOrMore>
-    </element>
-  </define>
-  <define name="ANY">
-    <element>
-      <anyName>
-        <except>
-          <name>interface</name>
-          <name>requires</name>
-          <name>object</name>
-          <name>property</name>
-          <name>signal</name>
-          <name>child</name>
-          <name>menu</name>
-          <name>item</name>
-          <name>attribute</name>
-          <name>link</name>
-          <name>submenu</name>
-          <name>section</name>
-        </except>
-      </anyName>
-      <zeroOrMore>
-        <attribute>
-          <anyName/>
-          <text/>
-        </attribute>
-      </zeroOrMore>
-      <interleave>
-        <zeroOrMore>
-          <ref name="ALL"/>
-        </zeroOrMore>
-        <optional>
-          <text/>
-        </optional>
-      </interleave>
-    </element>
-  </define>
-  <define name="ALL">
-    <element>
-      <anyName/>
-      <zeroOrMore>
-        <attribute>
-          <anyName/>
-          <text/>
-        </attribute>
-      </zeroOrMore>
-      <interleave>
-        <zeroOrMore>
-          <ref name="ALL"/>
-        </zeroOrMore>
-        <optional>
-          <text/>
-        </optional>
-      </interleave>
-    </element>
-  </define>
-</grammar>